<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.chilli.cosima.common.Auther" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
		<base href="<%=basePath%>" />
		<title>Insert title here</title>
		<link href="css/validate.css" rel="stylesheet" type="text/css" />
		<link href="css/common.css" rel="stylesheet" type="text/css" />			
		<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
		<script src="js/jquery.tablesorter.min.js" type="text/javascript"></script>
		
	</head>
	<body>
	<div id="man_zone">
		<div class="navbar">
			系统管理 > 日志管理 > 日志列表
		</div>
		<div class="toolbar">
			<%if (Auther.isPermitted(Auther.RUNLOG_EDIT)) {%>					
			<input type="button" value="修改log4j配置" class="button_80" onMouseOver="this.className='button_80_over'" onMouseOut="this.className='button_80'" onclick="doEdit()" />
			<% }%>	
			<!-- <input type="button" value="删除" class="button_60" onMouseOver="this.className='button_60_over'" onMouseOut="this.className='button_60'" onclick="doDelete()" /> -->
		</div>
 		
		<div class="main_content" >
			<s:form name="form" id="form" action="runlog/runLogQueryAction.action" method="post" theme="simple">	
			  <table id="tablesorter-list" class="tablesorter" border="0" cellpadding="0" cellspacing="1" align="center" id="myTable">
				<thead>
			   		<tr>
						<th>
							文件名
						</th>
						<th>
							最后修改时间
						</th>
						<th>
							大小
						</th>
						<th>
							<s:text name="user.operate" />
						</th>
					</tr>
				</thead>
				<tbody>
				<s:iterator id="bean" value="#request.valueList">
					<tr>
						<td>
							<s:property value="#bean.name" />
						</td>
						<td>
							<s:property value="#bean.time" />
						</td>
						<td>
							<s:property value="#bean.size" />
						</td>
						<td>
							<%if (Auther.isPermitted(Auther.RUNLOG_DOWNLOAD)) {%>
							<span class="opt_span" onclick="doDownLoad('<s:property value="#bean.name" />')">下载</span>
							<% }%>
							&nbsp;&nbsp;&nbsp;
							<%if (Auther.isPermitted(Auther.RUNLOG_DEL)) {%>
							<span class="opt_span" onclick="doDelete('<s:property value="#bean.name" />')"><s:text name="user.delete" /></span>
							<% }%>
						</td>
					</tr>
				</s:iterator>
				</tbody>
				
				</table>
				<div class="pager_div"><%@ include file="/WEB-INF/jsp/pager.jsp"%></div>
		</s:form>
		</div>
	</div>
	</body>
	<script language="javascript">

		function doEdit() 
		{
        	var myForm = document.getElementById("form");
        	myForm.action = "runlog/runLogEditAction!jumpPage.action";
            myForm.submit();
		}

		function doDownLoad(name) 
		{
        	var myForm = document.getElementById("form");
        	myForm.action = "runlog/runLogDownLoadAction.action?name="+name;
            myForm.submit();
		}

		function doDelete(name) 
		{
			if(confirm("你确定删除这个日志文件吗？删除后将不可恢复。")) 
			{
	        	var myForm = document.getElementById("form");
	        	myForm.action = "runlog/runLogDelAction.action?name="+name;
	            myForm.submit();
			}

		}

	</script>
</html>